#ifndef SOUNDTAB_H_
#define SOUNDTAB_H_

#include <QWidget>
#include <QVBoxLayout>
#include <QLabel>
#include <QGroupBox>
#include <QFormLayout>
#include <QPushButton>
#include <QComboBox>
#include <QScrollBar>
#include <QSound>
#include <QScrollArea>
#include <QPixmap>

#include "SoundPlot.h"

class SoundTab : public QWidget
{
	Q_OBJECT

	private:
		QVBoxLayout *mainLayout;

		QGroupBox *blocPlayer;
		QPushButton *pause;
		QPushButton *stop;
		QPushButton *start;
		QSound *sound;
		QWidget *nosoundWidget;
		QLabel *nosoundLabel;

		QGroupBox * GroupBoxBloc;
		QGridLayout * GridLayout;
		QVBoxLayout ** blocksLayout;
		QGroupBox   ** blocksBox;
		QComboBox   ** blocksSelect;
		QScrollArea ** scrollArea;

		SoundObj * soundObj;
		SoundObj * tmpSO;
		long nbrChannel;

		SoundPlot ** SoundPlots;


	public:
		SoundTab(SoundObj *so, QWidget *parent = 0);
		~SoundTab();
		void repaint();
		void buildBlocks();
		void actionsOnButtons();
		void setSound(QSound*);
		void setSoundObj(SoundObj*);
		void addSoundPlot1(SoundPlot* sp);

	private:
		void buildBlocByChannel(long);
		void buildPlayer();
		void buildEmptyBlock();
		void clear();

	public slots:
		//Test
		void startSound();
		void stopSound();
		void pauseSound();
};

#endif
